import {
    setStore,
    getStore
} from '@/utils/store'
import website from '@/const/website'

const common = {
    state: { 
        isCollapse: false,
        isFullScreen: false,
        screen: -1,
        showTag: getStore({ name: 'showTag' }),
        showFullScreen: getStore({ name: 'showFullScreen' }),
        showMenu: getStore({ name: 'showMenu' }),
        website: website,
    },
    actions: {
    },
    mutations: {
        set_fullScreen: (state) => {
            state.isFullScren = !state.isFullScren
        },
        set_collapse: (state) => {
            state.isCollapse = !state.isCollapse;
        },
        set_showTag: (state, active) => {
            state.showTag = active
            setStore({
                name: 'showTag',
                content: state.showTag
            })
        },
        set_showMenu: (state, active) => {
            state.showMenu = active
            setStore({
                name: 'showMenu',
                content: state.showMenu
            })
        },
        set_showfullScreen: (state, active) => {
            state.showFullScren = active
            setStore({
                name: 'showFullScreen',
                content: state.showFullScren
            })
        },
        set_screen: (state, screen) => {
            state.screen = screen
        }
    }
}

export default common